﻿using System;
using System.Collections.Generic;
using System.Text;
using Wangzeran.CodeMaker.Core.Model;

namespace Wangzeran.CodeMaker.Core.DB
{
    /// <summary>
    /// 数据库数据操作
    /// </summary>
    public interface IDBDAL
    {
        
        /// <summary>
        /// 获取该列的所有值
        /// </summary>
        /// <param name="columnName">列名</param>
        /// <returns>该列的所有值集合</returns>
        IList<ColumnModal> GetColumnValues(string columnName);

        /// <summary>
        /// 获取该列的值
        /// </summary>
        /// <param name="id">标识ID</param>
        /// <param name="columnName">列名</param>
        /// <returns>列实体</returns>
        ColumnModal GetColumnValue(object id, string columnName);

        /// <summary>
        /// 获取该列的值
        /// </summary>
        /// <param name="id">标识ID</param>
        /// <param name="columnName">列实体</param>
        void GetColumnValue(object id, ColumnModal column);

        /// <summary>
        /// 获取某一条实体数据
        /// </summary>
        /// <param name="id">标识ID</param>
        /// <returns>行实体</returns>
        RowModal GetRowValues(object id);

        /// <summary>
        /// 获取某一条实体数据
        /// </summary>
        /// <param name="id">行实体</param>
        void GetRowValues(RowModal row);

        /// <summary>
        /// 获取该表的所有数据
        /// </summary>
        /// <param name="table">表实体</param>
        void GetTableValues(TableModal table);

        /// <summary>
        /// 获取该表的所有数据
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <returns>表实体</returns>
        TableModal GetTableValues(string tableName);
    }
}
